package com.zqx.demo2;

/**
 * @author xiang.orchid@gmail.com
 * @Create 2016-10-13 11:22
 */

public class Factory {

    //静态工厂方法
    public static Product getProduct(String arg) {
        Product product = null;
        if(arg.equalsIgnoreCase("A")){
            product = new ConcreteProduct();
            //初始化设置product
        } else if (arg.equalsIgnoreCase("B")) {
            product = new ConcreteProductB();
            //初始化设置product
        }
        return product;
    }
}
